package com.song.email.util.common;

public class Counter {
	// 发送成功数
	public static long mailSendSuccessCount;
	//发送失败数
	public static long mailSendFailCount;
	//总任务数
	public static long sumWorkCount;
	//auth 数
	public static long authCount;
	

	private static String[] lock = {"1","2","3","4","5"};

	public synchronized static void init() {
		// 发送成功数
		mailSendSuccessCount = 0;
		// 发送成功数
		mailSendFailCount = 0;
		//任务数
		sumWorkCount = 0;
		//auth 数
		authCount = 0;
	}
	
	public static void setMailSendSuccessCount() {
		synchronized (lock[0]) {
			mailSendSuccessCount++;
		}
	}
	public static void setMailSendFailCount() {
		synchronized (lock[1]) {
			mailSendFailCount++;
		}
	}

	public static void setMailsSumWorkCount() {
		synchronized (lock[2]) {
			sumWorkCount++;
		}
	}
	
	public static void setAuthCount() {
		synchronized (lock[3]) {
			authCount++;
		}
	}
}
